<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>

	<script src="vue_dev.js"></script>
	<script src="axios.min.js"></script>
	<script src="jquery-3.3.1.min.js"></script>
</head>
<body>
	<input type="text" id="name">
	<input type="text" id="count"> 
	<div id="app">
	<input type="submit" value="更新" v-on:click="update">
	</div>
	<script>
		(function ($) {  
			$.getUrlParam = function (name) {  

				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");  

				var r = window.location.search.substr(1).match(reg);  

				if (r != null) return unescape(r[2]); return null;  

			}  
		})(jQuery);
	</script>
	<script>

		$("#name").val($.getUrlParam('name')); 
		
		$("#count").val($.getUrlParam('count')); 
		
		var id = $.getUrlParam('id');
		var app = new Vue({
			el:"#app",
			data:{
				a:1
			},
			methods:{
				update:function () {
					var name = $("#name").val();
					var count =$("#count").val();
					axios
					.put('http://127.0.0.1/RESTful/class/'+id+'?name='+name+'&count='+count)
					.then(alert("更新成功"))
					.catch(error => {
						console.log(error)
					})
				}
			}
		})
	</script>
</body>
</html>